/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package renders;

import entidades.ArsARTICULO;
import org.zkoss.zul.Label;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;

/**
 *
 * @author lcarou
 */
public class ArticulosRender implements ListitemRenderer {
    
    public void render(Listitem listitem, Object value, int index) 
    {
     ArsARTICULO articulo = (ArsARTICULO)value;
     
     listitem.setValue(value);
     addListcell(listitem, articulo.getCodigo());
     addListcell(listitem, articulo.getDescripcion());     
     addListcell(listitem, articulo.getAlias()); 
     addListcell(listitem, articulo.getSeleccion()); 
     addListcell(listitem, articulo.getTipo()); 
    }

    private void addListcell(Listitem listitem, String value)
    {
    Listcell lc = new Listcell();
    Label lb = new Label(value);
    
    lb.setParent(lc);
    lc.setParent(listitem);
    }
}
